package ie.ncirl.nell;

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import org.apache.cordova.*;

public class MainActivity extends DroidGap {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
  //handle menu item selection
	public boolean onOptionsItemSelected(MenuItem item) {
		if (item.hasSubMenu() == false) {
			if (item.getItemId() == R.id.menu_exit) {
				finish();
			}
			if (item.getItemId() == R.id.menu_reload) {
				super.loadUrl("file:///android_asset/www/index.html");
			}
		}
		return true;
	}
}
